/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// IUserCard interface for NHibernate mapped table 'UserCard'.
	/// </summary>
	public interface IUserCard
	{
		#region Public Properties
		
		int uc_id
		{
			get ;
			set ;
			  
		}
		
		string uc_card
		{
			get ;
			set ;
			  
		}
		
		string uc_pass
		{
			get ;
			set ;
			  
		}
		
		int uc_times
		{
			get ;
			set ;
			  
		}
		
		byte uc_useful
		{
			get ;
			set ;
			  
		}
		
		byte uc_chargeMode
		{
			get ;
			set ;
			  
		}
		
		byte uc_state
		{
			get ;
			set ;
			  
		}
		
		int uc_user
		{
			get ;
			set ;
			  
		}
		
		DateTime uc_addTime
		{
			get ;
			set ;
			  
		}
		
		decimal? uc_kf
		{
			get ;
			set ;
			  
		}
		
		decimal? uc_yj
		{
			get ;
			set ;
			  
		}
		
		string uc_bz
		{
			get ;
			set ;
			  
		}
		
		int? uc_lastUser
		{
			get ;
			set ;
			  
		}
		
		DateTime? uc_updateTime
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// UserCard object for NHibernate mapped table 'UserCard'.
	/// </summary>
	[Serializable]
	public class UserCard : ICloneable,IUserCard
	{
		#region Member Variables

		protected int _uc_id;
		protected string _uc_card;
		protected string _uc_pass;
		protected int _uc_times;
		protected byte _uc_useful;
		protected byte _uc_chargemode;
		protected byte _uc_state;
		protected int _uc_user;
		protected DateTime _uc_addtime;
		protected decimal? _uc_kf;
		protected decimal? _uc_yj;
		protected string _uc_bz;
		protected int? _uc_lastuser;
		protected DateTime? _uc_updatetime;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public UserCard() {}
		
		public UserCard(string puccard, string pucpass, int puctimes, byte pucuseful, byte pucchargeMode, byte pucstate, int pucuser, DateTime pucaddTime, decimal? puckf, decimal? pucyj, string pucbz, int? puclastUser, DateTime? pucupdateTime)
		{
			this._uc_card = puccard; 
			this._uc_pass = pucpass; 
			this._uc_times = puctimes; 
			this._uc_useful = pucuseful; 
			this._uc_chargemode = pucchargeMode; 
			this._uc_state = pucstate; 
			this._uc_user = pucuser; 
			this._uc_addtime = pucaddTime; 
			this._uc_kf = puckf; 
			this._uc_yj = pucyj; 
			this._uc_bz = pucbz; 
			this._uc_lastuser = puclastUser; 
			this._uc_updatetime = pucupdateTime; 
		}
		
		public UserCard(string puccard, int puctimes, byte pucuseful, byte pucchargeMode, byte pucstate, int pucuser, DateTime pucaddTime)
		{
			this._uc_card = puccard; 
			this._uc_times = puctimes; 
			this._uc_useful = pucuseful; 
			this._uc_chargemode = pucchargeMode; 
			this._uc_state = pucstate; 
			this._uc_user = pucuser; 
			this._uc_addtime = pucaddTime; 
		}
		
		public UserCard(int pucid)
		{
			this._uc_id = pucid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int uc_id
		{
			get { return _uc_id; }
			set { _bIsChanged |= (_uc_id != value); _uc_id = value; }
			
		}
		
		public virtual string uc_card
		{
			get { return _uc_card; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("uc_card", "uc_card value, cannot contain more than 20 characters");
			  _bIsChanged |= (_uc_card != value); 
			  _uc_card = value; 
			}
			
		}
		
		public virtual string uc_pass
		{
			get { return _uc_pass; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("uc_pass", "uc_pass value, cannot contain more than 20 characters");
			  _bIsChanged |= (_uc_pass != value); 
			  _uc_pass = value; 
			}
			
		}
		
		public virtual int uc_times
		{
			get { return _uc_times; }
			set { _bIsChanged |= (_uc_times != value); _uc_times = value; }
			
		}
		
		public virtual byte uc_useful
		{
			get { return _uc_useful; }
			set { _bIsChanged |= (_uc_useful != value); _uc_useful = value; }
			
		}
		
		public virtual byte uc_chargeMode
		{
			get { return _uc_chargemode; }
			set { _bIsChanged |= (_uc_chargemode != value); _uc_chargemode = value; }
			
		}
		
		public virtual byte uc_state
		{
			get { return _uc_state; }
			set { _bIsChanged |= (_uc_state != value); _uc_state = value; }
			
		}
		
		public virtual int uc_user
		{
			get { return _uc_user; }
			set { _bIsChanged |= (_uc_user != value); _uc_user = value; }
			
		}
		
		public virtual DateTime uc_addTime
		{
			get { return _uc_addtime; }
			set { _bIsChanged |= (_uc_addtime != value); _uc_addtime = value; }
			
		}
		
		public virtual decimal? uc_kf
		{
			get { return _uc_kf; }
			set { _bIsChanged |= (_uc_kf != value); _uc_kf = value; }
			
		}
		
		public virtual decimal? uc_yj
		{
			get { return _uc_yj; }
			set { _bIsChanged |= (_uc_yj != value); _uc_yj = value; }
			
		}
		
		public virtual string uc_bz
		{
			get { return _uc_bz; }
			set 
			{
			  if (value != null && value.Length > 500)
			    throw new ArgumentOutOfRangeException("uc_bz", "uc_bz value, cannot contain more than 500 characters");
			  _bIsChanged |= (_uc_bz != value); 
			  _uc_bz = value; 
			}
			
		}
		
		public virtual int? uc_lastUser
		{
			get { return _uc_lastuser; }
			set { _bIsChanged |= (_uc_lastuser != value); _uc_lastuser = value; }
			
		}
		
		public virtual DateTime? uc_updateTime
		{
			get { return _uc_updatetime; }
			set { _bIsChanged |= (_uc_updatetime != value); _uc_updatetime = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			UserCard castObj = null;
			try
			{
				castObj = (UserCard)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._uc_id == castObj.uc_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _uc_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for UserCard 

	
	public interface IUserCardCollection : ICollection
	{
		UserCard this[int index]{	get; set; }
		void Add(UserCard pUserCard);
		void Clear();
	}
	
	[Serializable]
	public class UserCardCollection : IUserCardCollection
	{
		private IList<UserCard> _arrayInternal;

		public UserCardCollection()
		{
			_arrayInternal = new List<UserCard>();
		}
		
		public UserCardCollection( IList<UserCard> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<UserCard>();
			}
		}

		public UserCard this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((UserCard[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(UserCard pUserCard) { _arrayInternal.Add(pUserCard); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<UserCard> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
